/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

package edu.wpi.first.wpilibj.templates;


import edu.wpi.first.wpilibj.*;
import edu.wpi.first.wpilibj.DigitalInput;



/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the IterativeRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class LineTrackerTest extends IterativeRobot {
    /**
     * This function is run when the robot is first started up and should be
     * used for any initialization code.
     */
    DigitalInput leftline = new DigitalInput (1);
    DigitalInput centerline = new DigitalInput (2);
    DigitalInput rightline = new DigitalInput (3);

    public void robotInit() {

    }

    /**
     * This function is called periodically during autonomous
     */
    public void autonomousPeriodic() {

    }

    /**
     * This function is called periodically during operator control
     */
    public void teleopPeriodic() {
    getlinetracker();
    }
    public void getlinetracker(){
    int left = leftline.get()?(int)100:(int)0;
    int center = centerline.get()?(int)10:(int)0;
    int right = rightline.get()?(int)1:(int)0;
    int linetotal = left + center + right;

    switch(linetotal){
        case 111:
            System.out.println("all lines");
            break;
        case 110:
            System.out.println("left and center");
            break;
        case 100:
            System.out.println("left");
            break;
        case 011:
            System.out.println("center and right");
            break;
        case 001:
            System.out.println("right");
            break;
        case 000:
            System.out.println("no lines");
            break;
    }
    }
}
